package socdev.mobile;

import java.util.ArrayList;
import java.util.List;

import socdev.data.Message;
import socdev.data.Project;
import socdev.data.TeamUsersContainer;
import socdev.data.User;
import socdev.data.UsersContainer;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

public class TeamActivity extends Activity {

	private static TeamUsersContainer teamUsersContainer;
	private static Context context;
	private static ListView teamList;
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.team);
        
        User user = (User) getIntent().getExtras().get("user");
        Project project = (Project) getIntent().getExtras().get("project");
        
        teamList = (ListView) findViewById(R.id.team_list);
        teamUsersContainer = new TeamUsersContainer(user, project);
        context = this;
        
        teamUsersContainer.update(new Handler(), new HandlerRunnable());
        
       // messages.setAdapter(new MessageAdapter(this, R.layout.message_item, messagess));
        
       
        
        
    }
	
	static public class HandlerRunnable implements Runnable {
		public void run() {
			teamList.setAdapter(new TeamUsersAdapter(context, R.layout.user_item, teamUsersContainer.getAll()));
		}
	}
	

}

